package com.nectech.entity;

import com.nectech.util.GameUtil;

import java.awt.*;

/**
 * @Author: 浅小北
 * @ClassName: BackGround
 * @Description:
 * @Date: 2021/2/2 18:07
 * @Since: version-1.0
 */
public class BackGround extends AbstractMapleStoryObject{

    public static Image cloudImage = GameUtil.getImage("groundpic/background/whitecloud");
    public static Image skyImage = GameUtil.getImage("groundpic/background/bluesky");

    @Override
    public void draw(Graphics g) {
        for (int i = 0; i < 10; i++) {
            g.drawImage(cloudImage,(i * 700) + this.x,-200,null);
        }
        /*for (int i = 0; i < 100; i++) {
            g.drawImage(skyImage,this.x + (i * 22),this.y,null);
        }*/
        move();
    }

    int count = 0;

    @Override
    public void move() {
        count++;
        if (count % 3 ==0) {
            this.x -= 5;
        }
    }


    /*class Cloud extends AbstractMapleStoryObject {
        public Image cloudImage = GameUtil.getImage("groundpic/background/whitecloud");
        public Cloud(){
            this.x = 0;
            this.y = -200;
        }
        @Override
        public void draw(Graphics g) {
            g.drawImage(cloudImage,this.x,this.y,null);
        }
    }*/
}
